/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beanInfo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author VANTRUY
 */
@Entity
@Table(name = "Hotel")
@NamedQueries({
    @NamedQuery(name = "Hotel.findAll", query = "SELECT h FROM Hotel h"),
    @NamedQuery(name = "Hotel.findByHoteID", query = "SELECT h FROM Hotel h WHERE h.hoteID = :hoteID"),
    @NamedQuery(name = "Hotel.findByHoteName", query = "SELECT h FROM Hotel h WHERE h.hoteName = :hoteName"),
    @NamedQuery(name = "Hotel.findByHoteRating", query = "SELECT h FROM Hotel h WHERE h.hoteRating = :hoteRating"),
    @NamedQuery(name = "Hotel.findByAddress", query = "SELECT h FROM Hotel h WHERE h.address = :address"),
    @NamedQuery(name = "Hotel.findByImageurl", query = "SELECT h FROM Hotel h WHERE h.imageurl = :imageurl")})
public class Hotel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "hoteID")
    private Integer hoteID;
    @Column(name = "hoteName")
    private String hoteName;
    @Column(name = "hoteRating")
    private Integer hoteRating;
    @Column(name = "address")
    private String address;
    @Column(name = "imageurl")
    private String imageurl;
    @JoinColumn(name = "cityID", referencedColumnName = "cityID")
    @ManyToOne
    private City city;
    @OneToMany(mappedBy = "hotel")
    private List<Routing> routingList;

    public Hotel() {
    }

    public Hotel(Integer hoteID) {
        this.hoteID = hoteID;
    }

    public Integer getHoteID() {
        return hoteID;
    }

    public void setHoteID(Integer hoteID) {
        this.hoteID = hoteID;
    }

    public String getHoteName() {
        return hoteName;
    }

    public void setHoteName(String hoteName) {
        this.hoteName = hoteName;
    }

    public Integer getHoteRating() {
        return hoteRating;
    }

    public void setHoteRating(Integer hoteRating) {
        this.hoteRating = hoteRating;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getImageurl() {
        return imageurl;
    }

    public void setImageurl(String imageurl) {
        this.imageurl = imageurl;
    }

    public City getCity() {
        return city;
    }

    public void setCity(City city) {
        this.city = city;
    }

    public List<Routing> getRoutingList() {
        return routingList;
    }

    public void setRoutingList(List<Routing> routingList) {
        this.routingList = routingList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hoteID != null ? hoteID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Hotel)) {
            return false;
        }
        Hotel other = (Hotel) object;
        if ((this.hoteID == null && other.hoteID != null) || (this.hoteID != null && !this.hoteID.equals(other.hoteID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beanInfo.Hotel[hoteID=" + hoteID + "]";
    }

}
